<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <base th:href="${#request.getContextPath()}+'/'">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询（media queries）功能 -->
    <!-- 警告：通过 file:// 协议（就是直接将 html 页面拖拽到浏览器中）访问页面时 Respond.js 不起作用 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="css/default.css">
    <style type="text/css">
        .htmleaf-header {
            margin-bottom: 15px;
            font-family: "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", "FontAwesome", sans-serif;
        }

        .htmleaf-icon {
            color: #fff;
        }
    </style>
</head>
<body>
<div>
    <table width="100%" border="0" cellspacing="6" cellpadding="0" >
        <tbody><tr valign="top">

            <td>
                <table width="100%" border="0" cellspacing="0" cellpadding="6" class="table table-striped table-bordered">
                    <tbody><tr>
                        <td valign="middle" class="blockTd">
                            <img src="img/icon012a6.gif">
                            商户信息列表
                            <input type="hidden" id="RelaCatalogID" name="RelaCatalogID" value="0">
                        </td>
                    </tr>
                    <tr>
                        <td style="padding: 0 8px 4px;">
                            <a href="javascript:void(0);" ztype="zPushBtn" class="zPushBtn" hidefocus="true" tabindex="-1" onselectstart="return false" onclick="add();return false;"><img src="img/icon003a2.gif"><b>新增&nbsp;</b>
                            </a>
                            <a href="javascript:void(0);" ztype="zPushBtn" class="zPushBtn" hidefocus="true" tabindex="-1" onselectstart="return false" onclick="edit();return false;"><img src="img/icon003a4.gif"><b>修改&nbsp;</b>
                            </a>
                            <a href="javascript:void(0);" ztype="zPushBtn" class="zPushBtn" hidefocus="true" tabindex="-1" onselectstart="return false" onclick="del();return false;"><img src="img/icon003a3.gif"><b>删除&nbsp;</b>
                            </a>
                            &nbsp;
                            &nbsp;
                            关键词:
                            <input name="searchText" type="text" id="searchText" onkeydown="enterSubmit();" class="ipt_style" value="">
                            <input type="button" name="sb" id="sb" class="btn_style" value="查询" onclick="return search();">
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-top: 0px; padding-left: 6px; padding-right: 6px; padding-bottom: 8px;">
                            <table width="100%" cellpadding="2" cellspacing="0" class="dataTable" sortstring="" id="dg1" page="true" size="0" multiselect="true" autofill="true" scroll="false" lazy="false" cachesize="0">
                                <tbody><tr ztype="head" class="dataTableHead">
                                    <td width="5%" align="center">
                                        序 号
                                    </td>
                                    <td width="3%" align="center" ztype="selector" field="id">
                                        <input type="checkbox" value="*" id="dg1_AllCheck" onclick="DataGrid.onAllCheckClick('dg1')">
                                    </td>
                                    <td align="center" width="10%">
                                        <b>状&nbsp;态</b>
                                    </td>

                                    <td align="center" width="15%">
                                        <b>登录账号</b>
                                    </td>

                                    <td align="center" width="20%">
                                        <b>商户名称</b>
                                    </td>

                                    <td align="center" width="12%">
                                        <b>等&nbsp;级</b>
                                    </td>

                                    <td align="center" width="10%">
                                        <b>QQ号码</b>
                                    </td>

                                    <td align="center" width="10%">
                                        <b>联系电话</b>
                                    </td>

                                    <td align="center" width="15%">
                                        <b>创建时间</b>
                                    </td>
                                </tr>

                                <tr th:each="m,merchant : ${list}" height="35" id="87529766_tr" ondblclick="edit('87529766');" onclick="DataGrid.onRowClick(this,event);">



                                    <td align="center" th:text="${merchant.count}">
                                        1
                                    </td>

                                    <td align="center" onclick="DataGrid.onSelectorClick(this,event);" ondblclick="stopEvent(event);">
                                        <input type="checkbox" name="dg1_RowCheck" id="dg1_RowCheck1" value="87529766">
                                    </td>

                                    <td align="center">
                                        <font color="green" th:if="${m.state==1}">有效</font>
                                        <font color="green" th:if="${m.state==0}">无效</font>
                                    </td>

                                    <td align="center">
                                        <a href="#" onclick="see('87529766')" title="点击修改查看/商户" th:text="${m.loginName}">45345</a>
                                    </td>

                                    <td align="center" th:text="${m.customerName}">
                                        eegr
                                    </td>


                                    <td align="center">
                                        <span style="width:30px;color:gray;" th:if="${m.level==0}">非认证商户</span>
                                        <span style="width:30px;color:gray;" th:if="${m.level>0}">认证商户V<span th:text="${m.level}">1</span></span>

                                    </td>

                                    <td align="center" th:text="${m.qq}">
                                        345345
                                    </td>

                                    <td align="center"  th:text="${m.phone}">
                                        453453
                                    </td>

                                    <td align="center"  th:text="${m.createtime}">
                                        &nbsp;2019/07/03 19:01:51
                                    </td>

                                </tr>

                                <tr>
                                    <td colspan="9" align="center" id="dg1_PageBar" class="pagebg">
                                        <div style="float: right; font-family: Tahoma;" class="flickr">
                                            <span class="current">1</span>
                                        </div>

                                        <div style="float: left; font-family: Tahoma">
                                            共 3 条记录，每页 20 条，共 1 页
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </td>
        </tr>
        </tbody>
    </table>
</div>

<!--新增商户点击弹出的模态框页面-->
<div>

    <!-- Modal -->
    <div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">新增商户</h4>
                </div>
                <div id="merchantAddDiv" class="modal-body">
                    ...
                </div>
                <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" id="save" class="btn btn-primary">保存</button>
            </div>
            </div>
        </div>
    </div>
</div>

<!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
<script src="js/jquery-3.1.1.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>


<script src="js/bootstrap-treeview.js"></script>
<script type="text/javascript">
    //点击新增按钮显示弹窗
    function add() {
        /**
         *加载merchant-add弹窗
         */
        $("#merchantAddDiv").load("page/merchant-add.html")
        /**
         * 显示弹窗
         */
        $("#myModal").modal("show");
    }

    $("#save").click(function () {
        save();
    });
</script>
</body>
</html>